<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vue的起步和插值</title>
</head>

<body>
    <div id="app">
        <h2>{{ msg }}</h2>
        <h3>{{ 2 }}</h3>
        <h3>{{ "hello" }}</h3>
        <h3>{{ {id:1} }}</h3>
        <h3>{{ 1>2 ? '真的':'假的'}}</h3>
        <h3>{{ txt.split('').reverse().join('') }}</h3>
        <h1>{{ getContent() }}</h1>
        <h1>{{ msg3 }}</h1>
    </div>
    <!-- 1.引包 -->
    <script src="./vue.js"></script>
    <script>
        // console.log(Vue);

        // 2.初始化
        const vm = new Vue({
            el: '#app',
            // 数据属性
            data: {
                msg: 'hello vue',
                txt: 'hello',
                msg2: 'content',
                msg3:'<p>插值语法</p>'
            },
            // 存放的是方法
            methods: {
                getContent() {
                    return this.msg + ' ' + this.msg2;
                }
            }
        });
        console.log(vm.msg);
        
    </script>

</body>

</html>